/*
 *  $Id: PlayerGameResolver.cs 1218 2010-11-28 14:03:06Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008-2010 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

using Nereal.Serialization;

namespace Ragima.Serialization {
    public sealed class PlayerGameResolver : IKeyResolver<bool, Player> {
        public bool ResolveKey(Player value) {
            return Game.Current.GetPlayerId(value);
        }

        public Player ResolveValue(bool key) {
            return Game.Current.GetPlayerById(key);
        }
    }
}
